package com.itheima.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@Aspect //切入面
public class AspectTest02 {
    //    前置通知
    @Before("@annotation(com.itheima.aop.Log)")
    public void before() {
        log.info("AspectTest02->before...");
    }

    // DeptServiceImpl实现类中的 查找和修改为目标类，且分别对其进行前置和后置通知

    //后置通知
    @After("@annotation(com.itheima.aop.Log)")
    public void after() {
        log.info("MyAspect6 -> after ...");
    }
}